package com.soma.game.job;


import com.soma.game.enums.GameStaticType;
import com.soma.game.service.GameStaticService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @program: soma-game
 * @description: 清除阶段得分数据
 * @author: hduprince
 * @create: 2018-07-18 16:40
 **/
@Component
public class ClearScoreJob {

    Logger logger = LoggerFactory.getLogger(ClearScoreJob.class);

    @Resource
    private GameStaticService gameStaticService;

    @Scheduled(cron = "0 0 3 ? * MON")
    //@Scheduled(fixedDelay = 1000)
    public void execute(){
        logger.info("start : 清除本周游戏得分数据");
        gameStaticService.clearScore(GameStaticType.week);
        logger.info("end : 清除本周游戏得分数据");
    }
}
